package designPattern.creation5.FactoryMethod.chapter13_factorymethod.chapter13_6;

//工厂方法示例子：
// 创建药品对象
public class Application {


    public static void main(String args[]) {
        IDrugFactory factory;
        Drug drug;

        factory = new ParaDrugFactory();
        drug = factory.getDrug();
        System.out.println(drug.getName() + "的成份:");
        System.out.println(drug.getConstitute());

        factory = new AmorDrugFactory();
        drug = factory.getDrug();
        System.out.println(drug.getName() + "的成份:");
        System.out.println(drug.getConstitute());
    }
}
